import {always, buildMenu} from "@/utils/permission";

export function menuExpenditure(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0072', 'expenditure', '/expenditure', 'noRedirect', 'Layout', '收支控制', 'payee')
    o.children.push(menuExpenditureSetting(permissionCodes))
    o.children.push(menuExpenditureBasal(permissionCodes))
    o.children.push(menuExpenditureInitialize(permissionCodes))
    o.children.push(menuExpenditureKpis(permissionCodes))
    o.children.push(menuExpenditureExpenses(permissionCodes))
    o.children.push(menuExpenditureDisbursement(permissionCodes))
    // o.children.push(menuExpenditureExecution(permissionCodes))
    // o.children.push(menuExpenditureDepartment(permissionCodes))
    return o
}

function menuExpenditureSetting(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0073', 'setting', 'setting', 'noRedirect', 'ParentView', '系统配置', 'swagger')
    o.children.push(buildMenu(permissionCodes, 'PD0102', 'expenditureSettings', 'expenditureSettings', '', 'expenditure/setting/expenditureSettings/index', '收支系统配置', 'settings'))
    o.children.push(buildMenu(permissionCodes, 'PD0103', 'expenditureFeetypeFile', 'expenditureFeetypeFile', '', 'expenditure/setting/expenditureFeetypeFile/index', '报账费用类型附件', 'filetype'))
    o.children.push(buildMenu(permissionCodes, 'PD0104', 'expenditureTravelQuota', 'expenditureTravelQuota', '', 'expenditure/setting/expenditureTravelQuota/index', '差旅限额标准', 'limit'))
    return o
}

function menuExpenditureBasal(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0074', 'basal', 'basal', 'noRedirect', 'ParentView', '基础档案', 'archives')
    o.children.push(buildMenu(permissionCodes, 'PD0075', 'expenditurePtype', 'expenditurePtype', '', 'expenditure/basal/expenditurePtype/index', '项目类型', 'classify'))
    o.children.push(buildMenu(permissionCodes, 'PD0105', 'expenditureFunctional', 'expenditureFunctional', '', 'expenditure/basal/expenditureFunctional/index', '功能分类', 'functional'))
    o.children.push(buildMenu(permissionCodes, 'PD0106', 'expenditureEconomic', 'expenditureEconomic', '', 'expenditure/basal/expenditureEconomic/index', '经济分类', 'economic'))
    o.children.push(buildMenu(permissionCodes, 'PD0107', 'expenditureFiscal', 'expenditureFiscal', '', 'expenditure/basal/expenditureFiscal/index', '财政项目', 'fiscal'))
    o.children.push(buildMenu(permissionCodes, 'PD0108', 'expenditureSubject', 'expenditureSubject', '', 'expenditure/basal/expenditureSubject/index', '会计科目', 'subject'))
    o.children.push(buildMenu(permissionCodes, 'PD0109', 'expenditureProceeds', 'expenditureProceeds', '', 'expenditure/basal/expenditureProceeds/index', '收款单位', 'company'))
    o.children.push(buildMenu(permissionCodes, 'PD0110', 'expenditureBusinessCard', 'expenditureBusinessCard', '', 'expenditure/basal/expenditureBusinessCard/index', '收款公务卡', 'card'))
    o.children.push(buildMenu(permissionCodes, 'PD0111', 'expenditureAccount', 'expenditureAccount', '', 'expenditure/basal/expenditureAccount/index', '付款账号', 'bankbook'))
    return o
}

function menuExpenditureInitialize(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0098', 'initialize', 'initialize', 'noRedirect', 'ParentView', '初始化数据', 'job')
    o.children.push(buildMenu(permissionCodes, 'PD0112', 'expenditureInitQuota', 'expenditureInitQuota', '', 'expenditure/initialize/expenditureInitQuota/index', '额度下达初始化', 'init'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureInitQuotaEdit', 'expenditureInitQuotaEdit', '', 'expenditure/initialize/expenditureInitQuota/edit', '额度下达初始化编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0113', 'expenditureInitReimbursement', 'expenditureInitReimbursement', '', 'expenditure/initialize/expenditureInitReimbursement/index', '报账初始化', 'skill'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureInitReimbursementEdit', 'expenditureInitReimbursementEdit', '', 'expenditure/initialize/expenditureInitReimbursement/edit', '报账初始化编辑', ''))
    return o
}

function menuExpenditureKpis(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0099', 'kpis', 'kpis', 'noRedirect', 'ParentView', '指标管理', 'kpis')
    o.children.push(buildMenu(permissionCodes, 'PD0114', 'expenditureKpi', 'expenditureKpi', '', 'expenditure/kpis/expenditureKpi/index', '指标单', 'kpi'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureKpiEdit', 'expenditureKpiEdit', '', 'expenditure/kpis/expenditureKpi/edit', '指标单编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0115', 'expenditureQuota', 'expenditureQuota', '', 'expenditure/kpis/expenditureQuota/index', '额度下达单', 'quota'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureQuotaEdit', 'expenditureQuotaEdit', '', 'expenditure/kpis/expenditureQuota/edit', '额度下达单编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0116', 'expenditureAdjustment', 'expenditureAdjustment', '', 'expenditure/kpis/expenditureAdjustment/index', '调整单', 'adjust'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureAdjustmentEdit', 'expenditureAdjustmentEdit', '', 'expenditure/kpis/expenditureAdjustment/edit', '调整单编辑', ''))
    return o
}

function menuExpenditureExpenses(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0100', 'expenses', 'expenses', 'noRedirect', 'ParentView', '报账管理', 'textarea')
    o.children.push(buildMenu(permissionCodes, 'PD0117', 'expenditureApplication', 'expenditureApplication', '', 'expenditure/expenses/expenditureApplication/index', '事前用款申请单', 'application'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureApplicationEdit', 'expenditureApplicationEdit', '', 'expenditure/expenses/expenditureApplication/edit', '事前用款申请单编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0118', 'expenditureReimbursement', 'expenditureReimbursement', '', 'expenditure/expenses/expenditureReimbursement/index', '报账单', 'reimbursement'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureReimbursementEdit', 'expenditureReimbursementEdit', '', 'expenditure/expenses/expenditureReimbursement/edit', '报账单编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0196', 'expenditureReimbursementOther', 'expenditureReimbursementOther', '', 'expenditure/expenses/expenditureReimbursementOther/index', '其他报账单', 'others'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureReimbursementOtherEdit', 'expenditureReimbursementOtherEdit', '', 'expenditure/expenses/expenditureReimbursementOther/edit', '其他报账单编辑', ''))
    return o
}

function menuExpenditureDisbursement(permissionCodes) {
    let o = buildMenu(permissionCodes, '', 'disbursement', 'disbursement', 'noRedirect', 'ParentView', '支出管理', 'disbursement')
    o.children.push(buildMenu(permissionCodes, 'PD0182', 'expenditureTreasury', 'expenditureTreasury', '', 'expenditure/disbursement/expenditureTreasury/index', '国库支付令', 'tokenpay'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureTreasuryEdit', 'expenditureTreasuryEdit', '', 'expenditure/disbursement/expenditureTreasury/edit', '国库支付令信息', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0183', 'expenditureInternetbank', 'expenditureInternetbank', '', 'expenditure/disbursement/expenditureInternetbank/index', '网银支付', 'netpay'))
    o.children.push(buildMenu(permissionCodes, always, 'expenditureInternetbankEdit', 'expenditureInternetbankEdit', '', 'expenditure/disbursement/expenditureInternetbank/edit', '网银支付信息', ''))
    return o
}

function menuExpenditureExecution(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0101', 'execution', 'execution', 'noRedirect', 'ParentView', '预算执行统计', 'report')
    o.children.push(buildMenu(permissionCodes, 'PD0165', 'budgetExecutionStatisticsReport', 'budgetExecutionStatisticsReport', '', 'expenditure/execution/budgetExecutionStatisticsReport/index', '预算执行统计', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0166', 'budgetExecutionDetails', 'budgetExecutionDetails', '', 'expenditure/execution/budgetExecutionDetails/index', '预算执行明细', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0167', 'projectExpenditureDetails', 'projectExpenditureDetails', '', 'expenditure/execution/projectExpenditureDetails/index', '项目支出明细', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0168', 'economicClassificationExpenditures', 'economicClassificationExpenditures', '', 'expenditure/execution/economicClassificationExpenditures/index', '经济分类支出', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0169', 'listofBudgetIndicators', 'listofBudgetIndicators', '', 'expenditure/execution/listofBudgetIndicators/index', '预算指标一览表', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0170', 'budgetIndicatorDetails', 'budgetIndicatorDetails', '', 'expenditure/execution/budgetIndicatorDetails/index', '预算指标明细表', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0171', 'fundsInPlaceList', 'fundsInPlaceList', '', 'expenditure/execution/fundsInPlaceList/index', '资金到位列表', 'monitor'))
    return o
}

function menuExpenditureDepartment(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0162', 'department', 'department', 'noRedirect', 'ParentView', '部门预算执行统计', 'report')
    o.children.push(buildMenu(permissionCodes, 'PD0163', 'expenditureQuery', 'expenditureQuery', '', 'expenditure/department/expenditureQuery/index', '部门预算支出明细查询', 'monitor'))
    o.children.push(buildMenu(permissionCodes, 'PD0164', 'departmentBudget', 'departmentBudget', '', 'expenditure/department/departmentBudget/index', '部门预算(经济分类)', 'monitor'))
    return o
}
